﻿/**
 * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.html or http://ckeditor.com/license
 */

CKEDITOR.editorConfig = function( config ) {
	// Define changes to default configuration here. For example:
    config.language = 'vi';
    config.htmlEncodeOutput = true;
    // config.uiColor = '#AADC6E';
	// Default setting.

//    config.toolbarGroups = [
//        { name: 'basicstyles', groups: ['basicstyles', 'cleanup'] },
//        { name: 'paragraph', groups: ['list', 'indent', 'align'] },
//        { name: 'colors' },
//        { name: 'others' }
	//    ];

	config.toolbar = 'Full';

	config.toolbar_Full =
    [
	    { name: 'document', items: ['Source'] },
	    { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'] },
	    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv',
	    '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock']
	    },
	    { name: 'links', items: ['Link', 'Unlink']},
	    { name: 'insert', items: ['Image', 'Flash', 'Table', 'HorizontalRule'] },
	    { name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
	    { name: 'colors', items: ['TextColor', 'BGColor'] },
	    { name: 'tools', items: ['Maximize', 'ShowBlocks'] }
    ];

	config.toolbar_Basic =
    [
	    ['Bold', 'Italic', 'Underline', '-', 'NumberedList', 'BulletedList','-', 'Image', 'Flash']
    ];
};
//Xóa lý tự thừa
CKEDITOR.on('instanceReady', function (ev) {
    ev.editor.on('paste', function (evt) {
        evt.data.dataValue = evt.data.dataValue.replace('&nbsp;', '');
        evt.data.dataValue = evt.data.dataValue.replace('<p></p>;', '');
        console.log(evt.data.dataValue);
    }, null, null, 9);
});